package com.demo.entity.enums;


public enum PostStatusEnum {

    DRAFT(0, "草稿"),
    POSTED(1, "已发布");

    private Integer status;
    private String desc;

    PostStatusEnum(Integer status, String desc) {
        this.status = status;
        this.desc = desc;
    }

    public static PostStatusEnum getByStatus(Integer status) {
        for (PostStatusEnum item : PostStatusEnum.values()) {
            if (item.getStatus().equals(status)) {
                return item;
            }
        }
        return null;
    }

    public Integer getStatus() {
        return status;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
